package cn.edu.cuit.elena.web.tool.mock;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import javax.servlet.AsyncContext;
import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.Part;

public class HttpServletRequestMock
    implements HttpServletRequest
{

    private HashMap<String, String> parameters;
    private HashMap<String, Object> attributes;
    private StringBuffer url;

    public HttpServletRequestMock()
    {
        parameters = new HashMap<String, String>();
        attributes = new HashMap<String, Object>();
    }

    public void setRequestUrl( String url )
    {
        this.url = new StringBuffer( url );
    }

    public void setParameter( String key, String value )
    {
        parameters.put( key, value );
    }

    public String getAuthType()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getContextPath()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public Cookie[] getCookies()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public long getDateHeader( String arg0 )
    {
        // TODO Auto-generated method stub
        return 0;
    }

    public String getHeader( String arg0 )
    {
        // TODO Auto-generated method stub
        return null;
    }

    public Enumeration getHeaderNames()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public Enumeration getHeaders( String arg0 )
    {
        // TODO Auto-generated method stub
        return null;
    }

    public int getIntHeader( String arg0 )
    {
        // TODO Auto-generated method stub
        return 0;
    }

    public String getMethod()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getPathInfo()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getPathTranslated()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getQueryString()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getRemoteUser()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getRequestURI()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public StringBuffer getRequestURL()
    {
        return url;
    }

    public String getRequestedSessionId()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getServletPath()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public HttpSession getSession()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public HttpSession getSession( boolean arg0 )
    {
        // TODO Auto-generated method stub
        return null;
    }

    public Principal getUserPrincipal()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public boolean isRequestedSessionIdFromCookie()
    {
        // TODO Auto-generated method stub
        return false;
    }

    public boolean isRequestedSessionIdFromURL()
    {
        // TODO Auto-generated method stub
        return false;
    }

    public boolean isRequestedSessionIdFromUrl()
    {
        // TODO Auto-generated method stub
        return false;
    }

    public boolean isRequestedSessionIdValid()
    {
        // TODO Auto-generated method stub
        return false;
    }

    public boolean isUserInRole( String arg0 )
    {
        // TODO Auto-generated method stub
        return false;
    }

    public Object getAttribute( String key )
    {
        return attributes.get( key );
    }

    public Enumeration getAttributeNames()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getCharacterEncoding()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public int getContentLength()
    {
        // TODO Auto-generated method stub
        return 0;
    }

    public String getContentType()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public ServletInputStream getInputStream() throws IOException
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getLocalAddr()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getLocalName()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public int getLocalPort()
    {
        // TODO Auto-generated method stub
        return 0;
    }

    public Locale getLocale()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public Enumeration getLocales()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getParameter( String arg0 )
    {
        // TODO Auto-generated method stub
        return null;
    }

    public Map getParameterMap()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public Enumeration getParameterNames()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String[] getParameterValues( String arg0 )
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getProtocol()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public BufferedReader getReader() throws IOException
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getRealPath( String arg0 )
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getRemoteAddr()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getRemoteHost()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public int getRemotePort()
    {
        // TODO Auto-generated method stub
        return 0;
    }

    public RequestDispatcher getRequestDispatcher( String arg0 )
    {
        url = new StringBuffer(arg0);
        return null;
    }

    public String getScheme()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public String getServerName()
    {
        // TODO Auto-generated method stub
        return null;
    }

    public int getServerPort()
    {
        // TODO Auto-generated method stub
        return 0;
    }

    public boolean isSecure()
    {
        // TODO Auto-generated method stub
        return false;
    }

    public void removeAttribute( String arg0 )
    {
        // TODO Auto-generated method stub

    }

    public void setAttribute( String arg0, Object arg1 )
    {
        attributes.put( arg0, arg1 );
    }

    public void setCharacterEncoding( String arg0 ) throws UnsupportedEncodingException
    {
        // TODO Auto-generated method stub

    }

	@Override
	public AsyncContext getAsyncContext() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DispatcherType getDispatcherType() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ServletContext getServletContext() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isAsyncStarted() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isAsyncSupported() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public AsyncContext startAsync() throws IllegalStateException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1)
			throws IllegalStateException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean authenticate(HttpServletResponse arg0) throws IOException,
			ServletException {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Part getPart(String arg0) throws IOException, ServletException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Collection<Part> getParts() throws IOException, ServletException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void login(String arg0, String arg1) throws ServletException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void logout() throws ServletException {
		// TODO Auto-generated method stub
		
	}
}
